package cn.com.taiji.oospub.wechat.entity;

import cn.com.taiji.entity.StringUUIDEntity;
import cn.com.taiji.oospub.wechat.common.Finals;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonValue;
import com.github.dreamyoung.mprelation.EntityMapper;
import com.github.dreamyoung.mprelation.JoinColumn;
import com.github.dreamyoung.mprelation.ManyToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Calendar;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author 
 * @since 2020-10-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OrderMainInfo  extends StringUUIDEntity implements Serializable {

    private static final long serialVersionUID = 1L;


    @TableField("School_Id")
    private String schoolId;
    @TableField(exist = false)
    @EntityMapper
    @ManyToOne
    @JoinColumn(name = "School_Id",referencedColumnName = "ID")
    private SchoolBaseInfo school;

    @TableField("Member_Id")
    private String memberId;
    @TableField(exist = false)
    @EntityMapper
    @ManyToOne
    @JoinColumn(name = "Member_Id",referencedColumnName = "ID")
    private MemberBaseInfo memberInfo;

    @TableField("Create_Time")
    private Calendar createTime;

    @TableField("Code")
    private String Code;

    @TableField("Sum_Amount")
    private Double sumAmount;

    @TableField("Order_Type")
    private String orderType;

    @TableField("Address")
    private String Address;

    @TableField("Status")
    private Finals.OrderStatus Status;

    @TableField("Printer")
    private String Printer;

    @TableField("Print_Time")
    private Calendar printTime;

    @TableField("Tracker")
    private String Tracker;

    @TableField("Track_Time")
    private Calendar trackTime;

    @TableField("Destroyer")
    private String Destroyer;

    @TableField("Destroy_Time")
    private Calendar destroyTime;

    @TableField("Remark")
    private String Remark;

    @TableField("Prepareer")
    private String Prepareer;

    @TableField("Prepare_Time")
    private Calendar prepareTime;

    private String pickupTime;

    private ProductPayWay payType;

    private Double logisticAmount;

    @TableField("endAddress")
    private String endAddress;

    private Double sumWeight;

    private String payer;

    private Calendar payTime;

    private String isComment;

    private String idDelete;

    @TableField(exist = false)
    private List<OrderDetailInfo> detailList;







    public enum ProductPayWay
    {
        HTZ("后台支付"){},
        WX("微信"){},
        ZFB("支付宝"){},
        CK("餐卡"){};

        @JsonValue
        private String value;

        private ProductPayWay(String value)
        {
            this.value = value;
        }

        public String getValue()
        {
            return value;
        }

    }


}
